package org.lee.basic.algorithm;

import java.util.Scanner;

/**
 * @author jackielee
 * @version 1.0
 * @description Expression1
 * @date 2021/4/19
 */
public class Expression1 {
  public static void main(String[] args) {
    int count;
    int number;
    try (Scanner s = new Scanner(System.in).useDelimiter("\\s*")) {
      number = s.nextInt();
      count = s.nextInt();
      System.out.println(express(number, count) + "=" + expressCount(number, count));
    }
  }

  private static String express(int number, int count) {
    StringBuilder sb = new StringBuilder(100);
    for (int i = 1; i <= count; ++i) {
      int n = i;
      while (n > 0) {
        sb.append(number);
        n--;
      }
      if (i < count) {
        sb.append("+");
      }
    }
    return sb.toString();
  }

  private static int expressCount(int number, int count) {
    int sum = 0;
    int subSum = 0;
    for (int i = 1; i <= count; ++i) {
      subSum = subSum * 10 + number;
      sum += subSum;
    }
    return sum;
  }
}
